package com.tj.bo.payment.client.enums;

import java.util.Objects;

/**
 * 支付订单类型
 *
 * @author ZhangChao
 * @since 2021/7/16
 */
public enum PayOrderTypeEnum {
    PAYMENT(0),
    DF_PAYMENT(1);
    private final Integer code;

    PayOrderTypeEnum(Integer code) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public static PayOrderTypeEnum getEnum(Integer code){
        for (PayOrderTypeEnum payOrderTypeEnum : PayOrderTypeEnum.values()){
            if (Objects.equals(code, payOrderTypeEnum.getCode())){
                return payOrderTypeEnum;
            }
        }
        return null;
    }
}
